package com.wr.hangzhounewlight.controller.frontend;

import com.wr.hangzhounewlight.obj.dto.frontend.LoginDTO;
import com.wr.hangzhounewlight.obj.dto.frontend.R;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yuanzhizhuo
 * createDate 2025/11/17
 */
@CrossOrigin
@RestController
public class LoginController {

    @PostMapping("/login")
    public R login(@RequestBody LoginDTO dto) {
        System.out.println(dto);
        if ("admin".equals(dto.getAccount()) && "123456".equals(dto.getPassword())) {
            return new R(200, "success", null);
        } else {
            return new R(400, "账户名或密码错误", null);
        }
    }

}
